package a_Map;

import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Set;

/**
 * @author Cheng-02
 * @version V1.0
 * @Package a_Map
 * @date 2024/4/11 下午5:36
 */
public class Test02 {
    public static void main(String[] args) {
        LinkedHashMap<String, Integer> map = new LinkedHashMap<>();
        map.put("a", 1);
        map.put("b", 2);
        map.put("c", 3);
        System.out.println(map.get("a"));
        map.remove("b");
        System.out.println(map.containsKey("a"));
        Set<String> keys = map.keySet();// 获取所有的键，并存入集合中
        for (String key : keys) {
            //根据key获取value
            System.out.println(key+"..."+map.get(key));//获取键对应的值
        }
    }
}
